<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" th:replace="layout (title='合同模板')">
<div th:fragment="content">
    <div class="m2ban wOpacity wow fadeIn" data-wow-delay="0.0s" th:style="'background-image:url('+${bannerInfo.imgSrc+')'}" >
        <div class="m2banTxt">
            <div class="m2ban_t1 wOpacity wow fadeInUp" data-wow-delay="0.2s" th:text="${bannerInfo.title}"></div>
            <div class="m2ban_des1 wOpacity wow fadeInUp" data-wow-delay="0.4s" th:text="${bannerInfo.realTitle}"></div>
        </div>
    </div>
    <div class="container wOpacity wow fadeIn" data-wow-delay="0.0s">
        <div class="m2htMain clearfix">
            <div class="m2htL">
                <div class="m2htItmNm">模板类型</div>
                <ul class="m2menu2">
                    <li th:class="${currentPid == 20 ? 'on' : ''}"><a href="/template" class="m2menu2_a">全部</a><span th:if="${currentPid == 20}" >全部</span></li>
                    <li th:class="${currentPid == t.id ? 'on' : ''}" th:each="t : ${typeList}"><a th:href="${'/template?pid='+t.id}" th:text="${t.title}" class="m2menu2_a"></a><span th:if="${currentPid == t.id}" th:text="${t.title}"></span></li>
                </ul>
            </div>
            <div class="m2htR">
                <div class="m2htR_t" th:text="${articleInfo.title}"></div>
                <div class="m2htRinfo">
                    <span th:text="${'所属分类：'+articleInfo.realTitle}"></span>
                    <span th:text="${'发布时间：'+#dates.format(articleInfo.updateTime, 'yyyy-MM-dd')}"></span>
                    <span th:text="${'浏览量：'+(articleInfo.viewCount+1)}"></span>
                    <span id="download" th:text="${'下载量：'+articleInfo.downloadCount}"></span>
                </div>
                <div class="m2fileBox" th:utext="${articleInfo.content}" style="height:700px;overflow: auto;"></div>
                <div class="m2htBom">
                    <a th:if="${articleInfo.fileSrc != ''}" th:href="'download?id='+${articleInfo.id}" id="downloadCount" target="_blank" class="m2ht_lgBtn">下载</a>
                    <a th:href="${'/template?pid='+currentPid}" class="m3nBack"></a>
                </div>
            </div>
        </div>
    </div>
    <script  th:inline="javascript">
        $(function () {
            $("#templateLi").addClass("hover");
        })
        $("#downloadCount").click(function(){
            var id  = [[${articleId}]]
            $.get("updateDownloadCount",{id:id,t:new Date().getTime() },function(data){
                $("#download").html("下载量：" + data.count)
            })
        })
    </script>
</div>
</html>